import java.awt.Color;
import java.awt.Graphics;

import javax.swing.JFrame;
import javax.swing.JPanel;

public class MyDrawPanel1 extends JPanel{
    
	public void paintComponent(Graphics g){
		
		g.fillRect(0, 0, this.getWidth(), this.getHeight());
		
		int red=(int)(Math.random()*255);
		int green=(int)(Math.random()*255);
		int blue=(int)(Math.random()*255);
		
		Color randomColor=new Color(red,green,blue);
		g.setColor(randomColor);
		g.fillOval(70, 70, 100, 100);
		
	}
	
	public static void main(String[] args){
		JFrame frame=new JFrame();
		
		MyDrawPanel1 panel=new MyDrawPanel1();
		
		frame.getContentPane().add(panel);
		
		frame.setSize(1000,1000);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setVisible(true);
	}
}
